﻿using Autofac;
using mesan.core.Managers;
using mesan.crosscutting.IoC;
using mesan.phone.library.Repository;

namespace mesan.phone.library
{
	public class AutofacContainer : IDiContainer
	{
		private readonly IContainer _container;

		public AutofacContainer()
		{
			var builder = new ContainerBuilder();

			builder.RegisterType<PasswordRequester>();
			builder.RegisterType<LoginManager>();

			_container = builder.Build();
		}

		public TInterface Get<TInterface>() where TInterface : class
		{
			return _container.Resolve<TInterface>();
		}
	}
}
